from inverseLearning import *
from gridWorldLearning import *
import sys
import numpy as np
import matplotlib.pyplot as plt

if __name__ == "__main__":
    from gridWorldAgent import *

    sys.path.append('../gridworld/')
    from GridWorld import *

    DaPingTai = DaPingTai(128, 0.3, 1)
    # goalstate = DaPingTai.getPostiveRewardState()
    # print goalstate
    w = np.zeros((64, 1))
    # w = np.array([0, 0, -1, 1, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, 0, 0]).reshape(16, 1)
    # w[goalstate] = 1
    agent = gridWorldAgent(w, DaPingTai)

    learn = gridWorldLearning(agent, DaPingTai, random=True, numberOfTrajectories=25)

    a=learn.computeExpertExpectation()
    print a
    # learn.updateAgent()

    # learn.train()
    # print learn.t,learn.count
    # x=learn.t
    # y=learn.count
    # plt.plot(y,x)
    # plt.show()